package e

const (
	DefaultLimit   = 50
	BanIpLimit     = 10 // 现在IP错误密码次数
	UserTokenLimit = 10 // 用户token数量限制
	SmsCodeLimit   = 20 // 限制每天每个IP、用户发送短信数量
	StatusOk       = 1  //webscoket 正确响应code
	StatusErr      = 2  //webscoket 错误响应code

	/****  挖矿模式 CVN 限额  ****/
	SinglePledgeCvn  = 3000.00
	MinerNumsLimit   = 20000
	BeliefNumsLimit1 = 300000
	BeliefNumsLimit2 = 550000
	BeliefNumsLimit3 = 750000

	// 三种模式对应的 收益p
	ProfitNormal              = 0.01
	ProfitMiner               = 0.05
	ProfitBelief              = 0.5
	ProfitUnPledgeStatistical = 0.50

	// 钛雾、网心Gbps结算
	TaiWuSettlementGbps = 2000.00
	WxSettlementGbps    = 1000.00

	// 路由器 质押CVN 门槛
	RouterPledgeCvnBase = 3000.00
	YtaRechargeCvntRate = 1.10

	// 保证金系数
	TokenPledgingNum     = 5 * 30
	TokenPledgingNumPres = 30.00
	TokenPledgingDay     = 5
	TokenPledgingCvnt    = 30

	// 系数F求值的常量
	IncomeBase             = 30.00
	BaseDynamicFlows       = 0.0003
	RouterDynamicFlows     = 0.03
	LinuxDynamicFlows      = 0.3
	WindowsDynamicFlows    = 0.03
	PaymentHourLimit       = 18 // 后面更换为20个小时
	PcPaymentHourLimit     = 10 // PC在线时长
	RouterPaymentHourLimit = 10 // 路由器在线时长
	PaymentFConstVar       = 24180.8
	PaymentFNodeNumVar     = 32336.00
	// CVN 初始币价
	PaymentFConstFirstCvn = 0.239
	PaymentFConstPowVar   = -0.635
	PaymentFConstFPowVar  = -1.5748
	PaymentFConstFVar     = 8000000
	// 全网结点数基数初始值
	SettlementBaseNode       = 12700.00
	SettlementBaseRouterNode = 0.00

	/**** time 相关配置 start ******/
	TimeFormatD       = "2006-01-02"
	TimeFormatS       = "2006-01-02 15:04:05"
	TimeFormatSecond  = 1
	TimeFormatMin     = 60
	TimeFormatHour    = 60 * 60
	TimeFormatCST     = 60 * 60 * 8
	TimeFormatDay     = 60 * 60 * 24
	TimeFormatWeek    = 60 * 60 * 24 * 7
	TimeFormatMonth   = 60 * 60 * 24 * 30
	TimeFormatYear    = 60 * 60 * 24 * 365
	TimeFormatTenYear = 60 * 60 * 24 * 365 * 10
	/**** time 相关配置 end ******/

	// redis 相关配置

	/**** 前缀 start ******/
	MqRedisPrefix     = "mq:"
	PublicRedisPrefix = "flows:"
	UserRedisPrefix   = "user:"
	BoardPrefix       = "board:"              // 看板数据
	OperateNodeData   = ":operate:node:data:" // 运营端结点缓存数据

	// 本地上传图片的路径
	PicResourceLocal   = "cvn_resource/pic/"
	ExcelResourceLocal = "cvn_resource/excel/"

	/**** 前缀 end ******/

	/**** 用户相关 start ******/
	RedisUserToken = ":token" // 用户Token 缓存数据
	/**** 用户相关 end   ******/

	/**** 公共缓存键 start ******/
	PublicCacheKeyPre = "cvn:public:"
	YqbCacheKeyPre    = "cvn:yqb:"
	//首页轮播图点击数缓存
	SlideShowClicksRedisKey = "slideShow:clicks:"

	//全网挖矿机CVNT持有信息
	RedisCvntCountInfoKey = "cvntCountInfo"

	/**** 全网常量 *****/
	GlobalVarName               = "global:var:name:"
	GlobalCvnBaseNum            = "cvn_base_number"       // cvn持有量基数  0
	GlobalSettlementNodeNum     = "settlement_node_num"   //挖矿结算全网节点数
	GlobalSettlementRouterNum   = "settlement_router_num" //挖矿结算路由器节点数
	SettlementNodeNum           = "settlement_node_num"
	SettlementRouterNum         = "settlement_router_num"
	SettlementBaseNodeNum       = "settlement_base_node_num"
	SettlementBaseRouterNodeNum = "settlement_base_router_num"

	/******  经销商相关 *******/
	UpgradeListForCache = "temp:agent:upgrade:list:" // 经销商缓存可升级列表

	//质押提取到账List
	RedisDrawListKey         = "draw:list"
	RedisRouterDrawListKey   = "draw:routerlist"
	RedisPCDrawListKey       = "draw:pclist"
	RedisTokenDrawListKey    = "draw:tokenlist"
	RedisTokenDepositListKey = "draw:depositlist"
	RedisDrawUnPledgeListKey = "draw:draw:unPledge:list"

	//账户注册签名
	RedisMobileRegSignCacheKey = "regSign:"
	//账户注册后短暂标识缓存键
	RedisUserRegMarkCacheKey = "regMark:"

	/**** user相关 start ******/
	UserInfoHashCacheKey        = ":info"
	UserLoginTokenCacheKey      = ":login:token"
	UserLoginTokenSetCacheKey   = ":login:authTokenSet"
	UserLoginShopToken          = ":login:shoptoken"   //商城及任务墙的登陆token
	UserLoginErrCountCacheKey   = ":login:errCount:"   //用户登录错误次数string 缓存key
	UserLoginErrIpCountCacheKey = ":login:ipCount"     //用户登录错误IP SET 缓存KEY
	UserLoginBlacklistCacheKey  = ":login:blacklist"   //用户登录黑名单标识string缓存key
	UserUsageSetCacheKey        = ":usage"             //用户使用设置的缓存Key
	UserMiningInfoCacheKey      = ":mining:info:"      //用户挖矿详情相关缓存Key
	UserTodayCvnTypeCacheKey    = ":mining:today:cvnt" //用户挖矿今日预计获得CVNT缓存Key

	UserRegSendcodeExpire    = "sendCode:expire:"   //用户发送验证码的有效期
	UserRegSendcodeSuccess   = "sendCode:success:"  //用户发送验证码的1小时内免验证
	UserRegSendcodeSucTimes  = "sendCode:count:"    //用户发送验证码的次数
	UserRegSendcodeFailTimes = "sendCode:errCount:" //用户验证验证码的错误次数

	UserMessageReadNumCacheKey = ":message:readNums" //用户已读消息条数
	RedisUserOldUploadKey      = ":oldUpload"        //用户路由器总上传量（老数据）
	RedisUserOldCvntKey        = ":oldCvnt"          //用户路由器总cvnt（老数据）
	RedisUserViewAgentUidList  = "viewAgentUidList:" //用户查看的经销商uid数组
	RedisUserBorrowNum         = ":borrowCount"      //用户借入的订单数
	RedisMinerApplyNum         = ":minerApplyNum"    //矿工申请加入记录数量

	// 结算相关参数
	StatisticalForCache        = "temp:statistical:for:user:cache"         // 运营端 路由器 结算列表
	PaymentForMgCache          = "temp:payment:for:mg:cache"               // 运营端 路由器 结算列表
	WxFlowsForMgCache          = "temp:wx:flows:mg:cache:list"             // 网心流量信息接口缓存
	WxNodeInfoForMgCache       = "temp:wx:node:mg:cache:list"              // 网心节点信息接口缓存
	WxNodeInfoForCache         = "temp:wx:node:mg:cache:info:"             // 网心节点信息接口缓存
	WxNodeIspForCache          = "node:isp:cache:"                         // 运营商信息数据缓存
	SubsidyRouterCache         = "temp:subsidy:router:cache:"              // 第三批路由器补偿
	StatisticalForUser         = "temp:statistical:for:user:list"          // 运营端 路由器 结算列表
	MultipleStatisticalForUser = "temp:multiple:statistical:for:user:list" // 运营端 路由器 结算列表
	MultipleStatisticalTag     = "temp:multiple:statistical:tag"           // 运营端 路由器 结算列表

	// 第三方流量运营商相关
	NodeFlowSourceCache = "temp:node:flow:source:" // 用户侧第三方开关
	NodeBindUserCache   = "temp:node:bind:uid:"    // 用户侧第三方开关

	/**** 生成金至尊会员的任务队列 ******/
	GenVipCodeSetCacheKey = "cvn:public:vipset"
	/**** 生成Token的任务队列 ******/
	GenTokenSetCacheKey = "cvn:public:tokenset"

	/**** user相关 end ******/

	//矿机数量hash缓存键
	MillInfoHashCacheKey = "mill:count"

	/**** 公共缓存键 end ******/

	// 配置图片URL前缀
	PicPathPrefix = "http://tu.jstucdn.com/ftp/"

	// 定时任务的时间设置
	// 每隔5秒执行一次：*/5 * * * * ?
	// 每隔1分钟执行一次：0 */1 * * * ?
	// 每天23点执行一次：0 0 23 * * ?
	// 每天凌晨1点执行一次：0 0 1 * * ?
	// 每月1号凌晨1点执行一次：0 0 1 1 * ?
	// 在26分、29分、33分执行一次：0 26,29,33 * * * ?
	CronSpecSec3   = "*/3 * * * * ?"
	CronSpecMin1   = "0 */1 * * * ?"
	CronSpecMin2   = "0 */2 * * * ?"
	CronSpecMin3   = "0 */3 * * * ?"
	CronSpecMin5   = "0 */5 * * * ?"
	CronSpecMin30  = "0 */30 * * * ?"
	CronSpecSec30  = "*/30 * * * * ?"
	CronSpecSec10  = "*/10 * * * * ?"
	CronSpecHour10 = "0 0 */1 * * ?"

	// 结算相关脚本
	SpecAddDailyBoard         = "00 12 00 * * ?"
	SpecDealOfflineNode       = "00 59 23 * * ?"
	SpecGlobalNodeNum         = "15 10 00 * * ?"
	SpecMiningCapacity        = "00 30 01 * * ?"
	SpecWxNodeFlow            = "00 22 * * * ?"
	SpecTwNodeFlow            = "00 25 * * * ?"
	SpecWxNodeInfo            = "0 */5 * * * ?"
	SpecPaymentSuper          = "00 33 10 * * ?"
	SpecSuperFirstYear        = "00 00 11 * * 1"
	SpecStatisticalForYx      = "00 33 00 * * ?"
	SpecPaymentToProfitDetail = "00 22 02 * * ?"
	SpecPaymentForYx          = "00 59 09 * * ?"
	SpecSupplyTokenCvn        = "25 00 12 * * ?"
	SpecPaymentForRentUser    = "25 40 01 * * ?"
	SpecSubsidyPayment        = "25 40 09 28 * ?"

	// 梨享相关配置参数
	GlobalNodeNumForCache     = "temp:settlement:node:num:type:"    // 全网节点数
	StatisticalForTag         = "temp:statistical:for:tag"          // 结算统计标示
	MultipleStatisticalForTag = "temp:multiple:statistical:for:tag" // 结算统计标示
	TempSuperMinerList        = "temp:super:miner:list"             // 矿工能力队列
	TempUserNodeList          = "temp:user:node:list"               // 矿工看板节点列表数据缓存

	//支付网关API
	ApiGetAddress   = "/api/app/v1/address/get"               //获取新地址
	ApiTransfer     = "/api/app/v1/transaction/transfer"      //转账提交
	ApiTransferInfo = "/api/app/v1/transaction/transfer/info" //获取转账信息
	ApiRechargeInfo = "/api/app/v1/transaction/info"          //获取充值信息

	//云钱包
	COIN_TYPE_ERC20       = "ERC20"
	COIN_NAME_CVNT        = "ETH_CVNT"
	COIN_NAME_USDT        = "ETH_USDT"
	COIN_DECIMAL_CVNT     = 8
	COIN_DECIMAL_USDT     = 6
	ReturnCommissionRatio = 0.3

	//审核触发条件
	CvnExamineSingleQuota         = 100     //单笔限额
	CvnExamineNewQuota            = 3000    //新地址
	CvnExamineDayQuota            = 100000  //日限额
	CvnExamineWeekQuota           = 500000  //周限额
	CvnExamineMonthQuota          = 1500000 //月限额
	CvnExamineSmallRecharge       = 1000    //小额充值
	CvnExamineSmallRechargeQuota  = 10000   //小额充值转账限额
	CvnExamineExceedQuota         = 30000   //提现超过充值金额限额
	UsdtExamineSingleQuota        = 10      //单笔限额
	UsdtExamineNewQuota           = 30      //新地址
	UsdtExamineDayQuota           = 1000    //日限额
	UsdtExamineWeekQuota          = 5000    //周限额
	UsdtExamineMonthQuota         = 15000   //月限额
	UsdtExamineSmallRecharge      = 10      //小额充值
	UsdtExamineSmallRechargeQuota = 100     //小额充值转账限额
	UsdtExamineExceedQuota        = 300     //提现超过充值金额限额

	//API签名
	SignExpire = 15

	//表名
	TableCobo    = "cobo"
	TableCvnLog  = "cvn_log"
	TableUsdtLog = "usdt_log"

	//令牌
	TokenRouterNode = 5

	//其他
	PayPasswordKey  = "sok093jsa872n5s"
	EmptyStrMd5     = "d41d8cd98f00b204e9800998ecf8427e"
	YqbWithdrawnKey = "3A4mrxQfmoxfhxqjKnR2Ah4sES5EB1KtrM"

	//管理后台
	AdminPhone  = "15071444644"
	AdminPhone2 = "15010367720"
)
